package com.zhm.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * Date： 2021/3/7 22:15
 *
 * @author ZHM
 */
@Configuration
public class ApplicationContextConfig {


    @Bean
    //使用@LoadBalanced 赋予RestTemplate 负载均衡的能力
    //  @LoadBalanced  注解掉，需要采用自定义轮询接口
    public RestTemplate getRestTemplate() {
        return new RestTemplate();
    }

}
